package org.oslims.client.uicomponents;

import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;

public class LabeledCheckBox extends Composite {

	private Object tag;
	private CheckBox checkBox = new CheckBox();
	private Label label = new Label();

	public LabeledCheckBox() {
		HorizontalPanel hp = new HorizontalPanel();
		hp.add(checkBox);
		hp.add(label);
		hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

		initWidget(hp);
	}

	public void setTag(Object tag) {
		this.tag = tag;
	}

	public Object getTag() {
		return tag;
	}

	public CheckBox getCheckBox() {
		return checkBox;
	}

	public void setText(String text) {
		label.setText(text);
	}

	public String getText() {
		return label.getText();
	}

	public void setLabelStyleName(String style) {
		label.setStyleName(style);
	}

}
